﻿@using CoralNode.MvcClient.Helper
@model CoralNode.Core.Entity.SearchQuerys.Prototype.PrototypeTagSearchQuery

@{
    ViewBag.Title = "ListTag";
    ViewData["curr"] = "tag";
}

@Html.IncludePage("CoralAdmin/prototype", "_Left", new { current = "prototype" })
<!--content-->
<div id="pbody">
    <div class="extra">
        <div class="pbody_top">
            <span class="ico ico_setting_setting"></span><span class="t t_c">内容设计&nbsp;&nbsp;/&nbsp;&nbsp;标签管理</span>
        </div>
        <div id="main">
             @Html.IncludePage("CoralAdmin/Prototype","_tab",new{prototypeId=ViewBag.Prototype.Id})
            <div class="">
                <div class="tablelist_style1" data-js="tabellist_style1">
                    <div class="funsearch p_1 pl_2 pr_2 extra_normal">
                        <div class="select_owner w_12-5 " data-meta="{value:'@ViewBag.Prototype.Id', btn:'<span class=\'ico ico_slide_down\'></span>' , clickbtn:'<span class=\'ico ico_slide_up\'></span>'}">
                            <ul>
                                @foreach (var item in @ViewBag.PrototypeList)
                                {
                                    if (@item.Id == @ViewBag.Prototype.Id)
                                    {
                                        <li data-value="@item.Id"><a class="current" href="/m/prototype/listTag?PrototypeId=@item.Id">@item.Title</a></li>
                                    }
                                    else
                                    {
                                        <li  data-value="@item.Id"><a  href="/m/prototype/listTag?PrototypeId=@item.Id">@item.Title</a></li>
                                    }
                                }
                            </ul>
                        </div>
                        <a class="btn_5 f_r ml_3" href="/m/prototype/createTag?prototypeId=@ViewBag.Prototype.Id">添加标签</a>
                        <div class="f_r">
                            <form method="POST" action="/m/prototype/listTag">
                                <span class="t_des f_l pt_0-5">所有标签：</span>
                                <label class="search f_l">
                                    @Html.TextBoxFor(m => m.Title, new { @class = "text w_18", @msg = "请输入关键字" })
                                    @Html.AntiForgeryToken()
                                    <input type="submit" value="" class="submit" />
                                </label>
                            </form>
                        </div>
                    </div>
                    <table cellpadding="0" cellspacing="0">
                        <tr class="exclude">
                            <th width="60">选择</th>
                            <th align="left" width="50">ID</th>
                            <th align="left">名称</th>
                            <th align="left">描述</th>
                            <th align="center" width="140">操作</th>
                        </tr>
                        @foreach (var item in @ViewBag.TagList.Items)
                        {
                            <tr>
                                <td>
                                    <label class="checkbox_own">
                                        <input type="checkbox" value="@item.Id"/></label></td>
                                <td class="td_left">@item.Id</td>
                                <td class="td_left"><a href="/m/prototype/editTag/@item.Id?prototypeId=@item.PrototypeId">@item.Title</a></td>
                                <td class="td_left">@item.Description</td>
                                <td>
                                    <div class="fun">
                                        <a href="/m/prototype/editTag/@item.Id?prototypeId=@item.PrototypeId">编辑</a><a href="/m/prototype/deleteTag/@item.Id" class="js_delete">删除</a>
                                    </div>
                                </td>
                            </tr>
                        }
                    </table>
                    <div class="global_fun ">
                        <label class="checkbox_own gloabal_select">
                            <input type="checkbox" /></label>
                        <input type="button" class="btn_4 btn invert" value="反选" /><input type="button" class="btn_4 btn reset"
                                                                                          value="重置" />
                        <a href="#" class="js_delete">删除</a>
                    </div>
                </div>

            </div>
        </div>
        <div id="pager">
            <div class="info_pg">共@(ViewBag.TagList.TotalItems)条</div>
            <div class="list_pg">
                <a href="/m/prototype/listTag?@ViewBag.queryString&p=1" class="first">首页</a>
                @if (@ViewBag.TagList.HasPreviousPage && @ViewBag.TagList.TotalItems > 0)
                {
                    <a href="/m/prototype/listTag?@ViewBag.queryString&p=@ViewBag.TagList.PreviousPageIndex" class="prev">上一页</a>
                }
                else
                {
                    <a class="prev none">上一页</a>
                }
                @foreach (var i in @ViewBag.TagList.PageArray)
                {
                    if (@i == @ViewBag.TagList.CurrentPageIndex)
                    {
                        <a class="current">@i</a>
                    }
                    else if (@i == 0)
                    {
                        <a class="more">…</a>
                    }
                    else
                    {
                        <a href="/m/prototype/listTag?@ViewBag.queryString&p=@i" href="#">@i</a>
                    }
                }
                @if (@ViewBag.TagList.HasNextPage && @ViewBag.TagList.TotalItems > 0)
                {
                    <a class="next" href="/m/prototype/listTag?@ViewBag.queryString&p=@ViewBag.TagList.NextPageIndex">下一页</a>
                }
                else
                {
                    <a class="next none">下一页</a>
                }
                <a class="last" href="/m/prototype/listTag?@ViewBag.queryString&p=@ViewBag.TagList.TotalPages">尾页</a>
                <!-- <span class="msg">跳转</span>
                    <input class="text" type="text" value="">
                    <span class="msg">页</span>-->
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
</script>
